import { useState, useEffect } from "react"
import { cctvAPI } from "@/api/article"
const useChannel = () => {
    const [channelList, setChannelList] = useState([])
    const getChannelList = async() => {
        const res = await cctvAPI()
        setChannelList(res.data.channels)
    }
    useEffect(() => { getChannelList() }, [])   
    // return出去
    return {
        channelList
    }
}
export { useChannel }